home *** CD-ROM | disk | FTP | other *** search
- #
- # This file is part of OpenVIP (http://openvip.sourceforge.net)
- #
- # Copyright (C) 2002-2003
- # Michal Dvorak, Jiri Sedlar, Antonin Slavik, Vaclav Slavik, Jozef Smizansky
- #
- # This program is licensed under GNU General Public License version 2;
- # see file COPYING in the top level directory for details.
- #
- # $Id: App.py,v 1.17 2003/06/04 13:41:52 tony_slavik Exp $
- #
-
- import sys, locale
- from wxPython.wx import *
- import globals, worker
-
- # this will save current thread's ID to logging.__mainThreadID:
- import logging
-
- import MainFrame
-
- mainFrame = None
-
- modules ={'FilterSettingsDialog': [0, '', 'FilterSettingsDialog.py'],
- 'MainFrame': [1, 'Main frame of Application', 'MainFrame.py'],
- 'ObjectPanel': [0, '', 'ObjectPanel.py'],
- 'TimelineWidget': [0, '', 'TimelineWidget.py']}
-
- class BoaApp(wxApp):
- """Main application. It performs the initialization and
- shows the main window."""
- def OnInit(self):
- locale.setlocale(locale.LC_NUMERIC, "C")
- globals.core.set_ui_callback(logging.UICallback())
-
- self.SetVendorName('OpenVIP')
- self.SetAppName('OpenVIP')
- if sys.platform == 'win32':
- self.cfg = wxConfig('OpenVIP', 'OpenVIP')
- else:
- self.cfg = wxConfig('OpenVIP', 'OpenVIP',
- '.openviprc', '/etc/openvip.conf')
- wxConfigBase_Set(self.cfg)
-
- wxInitAllImageHandlers()
- self.main = MainFrame.create(None)
- self.main.Show()
- global mainFrame
- mainFrame = self.main
-
- if len(sys.argv) == 2:
- self.main.OpenFile(sys.argv[1])
- else:
- self.main.OnNewTimeline(None)
-
- return true
-
- def main():
- application = BoaApp(0)
- application.MainLoop()
- worker.stop()
-
- if __name__ == '__main__':
- main()
-